package cn.itsource.ymcc.client;

import cn.itsource.ymcc.result.JsonResult;
import feign.hystrix.FallbackFactory;
import org.springframework.stereotype.Component;

@Component
public class MediaFeignClientFallbackFactory implements FallbackFactory<MediaFeignClient> {
    @Override
    public MediaFeignClient create(Throwable throwable) {
        return new MediaFeignClient() {
            @Override
            public JsonResult findMediaFileByCourseId(Long courseId) {
                throwable.printStackTrace();
                return JsonResult.error("findMediaFileByCourseId:"+throwable.getMessage());
            }
        };
    }
}
